package com.jgdt.jgdtkasannong_university_gene_backend.controller.test;

import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.jgdt.jgdtkasannong_university_gene_backend.biz.test.KasTestBiz;
import com.jgdt.jgdtkasannong_university_gene_backend.common.response.PageRequest;
import com.jgdt.jgdtkasannong_university_gene_backend.common.response.ResultVo;
import com.jgdt.jgdtkasannong_university_gene_backend.service.content.MediaService;
import com.jgdt.jgdtkasannong_university_gene_backend.service.content.SysMenuService;
import com.jgdt.jgdtkasannong_university_gene_backend.entity.content.SysMenu;
//import com.jgdt.jgdtkasannong_university_gene_backend.entity.test.KasTest;
import com.jgdt.jgdtkasannong_university_gene_backend.vo.test.KasTestVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description:
 * @author: huangAn 测试接口 todo 测试，注意生产需要注释该接口
 * @createDate: 2025/04/29
 */
@Tag(name = "测试管理接口",description = "测试管理接口")
@RestController
@RequestMapping("test/kasTest")
public class KasTestController {

//    @Autowired
//    private KasTestBiz kasTestBiz;
    @Autowired
    private SysMenuService sysMenuService;
    @Autowired
    private MediaService mediaService;

    @Operation(summary = "测试-直接放回字符串", description = "测试-直接放回字符串")
    @PostMapping("/test")
    public ResultVo<String> test() {
        return ResultVo.success("test");
    }

//    @Operation(summary = "测试-直接放回字符串", description = "测试-直接放回字符串")
//    @PostMapping("/queryKasTest")
//    public ResultVo<List<KasTest>>  queryKasTest() {
//       return ResultVo.success(kasTestBiz.queryKasTestList());
//    }
//
//    @Operation(summary = "测试-分页查询测试数据", description = "测试-分页查询测试数据")
//    @PostMapping("/pageKasTestList")
//    public ResultVo<?> pageKasTestList(@RequestBody PageRequest<KasTestVo> request){
//        return ResultVo.success(kasTestBiz.pageKasTestList(request));
//    }
//
//    @Operation(summary = "测试-分页查询测试数据01", description = "测试-分页查询测试数据01")
//    @PostMapping("/pageKasTestList01")
//    public ResultVo<IPage<KasTestVo>> pageKasTestList01(@RequestBody PageRequest<KasTestVo> request){
//        return ResultVo.success(kasTestBiz.pageKasTestList01(request));
//    }

    @GetMapping("/tree")
    public ResultVo<List<SysMenu>> getFullMenuTree() {
        return ResultVo.success(sysMenuService.getFullTree());
    }

    @GetMapping("/children")
    public ResultVo<List<SysMenu>> getChildren(@RequestParam Integer parentId) {
        return ResultVo.success(sysMenuService.getChildrenByParentId(parentId));
    }

    @GetMapping("/getImgUrl")
    public ResultVo<String> getChildren(@RequestParam String url) {
        return ResultVo.success(mediaService.getImgUrl(url));
    }
}




